.PHONY:all
all: client server test

BIN1=client
BIN2=server
CC=g++
LOAD1=-o
LOAD2=-c
FLAGS=-std=c++17

$(BIN1):UdpClient.o
	$(CC) $(LOAD1) $@ $^ $(FLAGS) 
UdpClient.o:UdpClient.cc
	$(CC) $(LOAD2) $< $(FLAGS)

$(BIN2):UdpServer.o
	$(CC) $(LOAD1) $@ $^ $(FLAGS) 
UdpServer.o:UdpServer.cc
	$(CC) $(LOAD2) $< $(FLAGS)

test:test.o
	$(CC) $(LOAD1) $@ $^ $(FLAGS)
test.o:test.cc
	$(CC) $(LOAD2) $< $(FLAGS)

.PHONY:clean
clean:
	rm -f $(BIN1) $(BIN2) UdpClient.o UdpServer.o test